<!doctype html>
<html>
<head>
<title>blog@admin|WonTube</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<#include "/admin/include/css.html">
</head>
<body>
<div id="page">
	<#include "/admin/include/header.ftl">
	<h1>&lt;Updating Blog&gt;</h1> 		
	<#if blog??>
	<div class="admin_content">  					
	<form id="add_blog_form">
		<input type="hidden" name="id" value="${blog.id}" id="blogId" />		
		<input type="hidden" name="sortIndex" value="${blog.sortIndex}" />
		<table>
			<tr><th>发布时间:<br />(格式 MM/dd/yyyy HH:mm:ss<br />时间部分可选)</th>
				<td><input type="text" name="createdString" value="${(blog.created)?datetime}"/></td>
				<th>url-title<br />(类似payphone-lyrics-maroon5, 唯一性)</th>
				<td><input type="text" name="urlTitle" value="${blog.urlTitle}"/></td>
			</tr>
			<tr><th>introduction: </th>
				<td><input type="text" name="introduction" value="${(blog.introduction)?replace("\"", "&quot;")}" /></td>
				<th>thumbnail: <br />(网络图片需要带http前缀. <br />其他图片相对项目根目录)</th>
				<td><input type="text" name="thumbnail"  value="${blog.thumbnail}"/></td>
			</tr>
			<tr><th>title<br />(blog title)</th>
				<td><input type="text" name="title"  value="${(blog.title)?replace("\"", "&quot;")}"/></td>
				<th>meta-title: </th>
				<td><input type="text" name="metaTitle"  value="${(blog.metaTitle)?replace("\"", "&quot;")}"/></td>
			</tr>
			<tr>
				<th>meta-description: </th>
				<td><input type="text" name="description" value="${(blog.description)?replace("\"", "&quot;")}" /></td>
				<th>meta-keywords: </th>
				<td><input type="text" name="keywords" value="${(blog.keywords)?replace("\"", "&quot;")}" /></td>				
			</tr>	
			<tr><th>category: </th>
				<td>
					<select name="category">
						<#assign name = blog.category ! ''>
						<#if name == ''>
						<option value=""></option>
						</#if>
						<#if categories??>
							<#list categories as cate>
								<#assign cname = cate.categoryName>
								<option value="${cname}" <#if name == cname>selected="selected"</#if> >${cname}</option>
				     		</#list>	
				     						
						</#if>						
					</select>
				</td>
				<th>tags:</th>
				<#assign utags = blog.tags ! ''>				
				<td>
				<#if tags??>
					<#list tags as tag>
						<#assign tname = tag.tagName>
						<#if utags?contains(tname)>
							<#assign check = "checked=\"true\"">
						<#else>
							<#assign check = "">
						</#if>
						<input type="checkbox" name="tagss" value="${tname}" ${check} />${tname} &nbsp;
					</#list>
				</#if>
				</td>
			</tr>		
			<tr>
				<th>author</th>
				<td><input type="text" name="author" value="${blog.author!''}" /></td>
			</tr>
		</table>
		<div id="blog_content_div">
			<textarea id="blog_content" style="display:none">${blog.content}</textarea>
		</div>
		<input type="button" value="更新并预览" id="update_blog_btn" />
	  </form>
    </div> 
    <#else>
    	No blog info.
    </#if>
	 <#include "/admin/include/footer.ftl">
</div>
</body>
<#include "/admin/include/js.html">

<script type="text/javascript" src="${contextPath}/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="${jsRoot}/admin/blog/blog_update.js"></script>
</html>